﻿@model IEnumerable<BookPart>
@using Contrib.Chapters.Models;

<h1>@Html.TitleForPage(T("Manage Books").ToString())</h1>
@using(Html.BeginFormAntiForgeryPost()) {
	@Html.ValidationSummary()
	<div class="manage">@Html.ActionLink(T("Add a Book").ToString(), "Create", new { }, new { @class = "button primaryAction" })</div>
	<fieldset>
		<table class="items" summary="@T("This is a table of the Books in your application")">
			<colgroup>
				<col id="Col1" />
				<col id="Col2" />
			</colgroup>
			<thead>
				<tr>
					<th scope="col">@T("Name")</th>
					<th scope="col"></th>
				</tr>
			</thead>
			@foreach ( var bookPart in Model ) {
			<tr>
				<td>
					@Html.ActionLink(Html.Encode(bookPart.Name), "Index", "ChapterAdmin", new { bookId = bookPart.Id }, new object { })
				</td>
				<td>
				@Html.ActionLink(T("Properties").ToString(), "Edit", new { id = bookPart.Id }) |
				@Html.ActionLink(T("Chapters").Text, "Index", "ChapterAdmin", new { bookId = bookPart.Id }, new object { }) |
				@Html.ActionLink(T("Delete").Text, "Delete", new { id = bookPart.Id }, new object { })
				</td>
			</tr>
			}
		</table>
	</fieldset>
}